<?php
$c_txt = (isset($c_txt)?$c_txt:'');
$sqla = "call sp_getUMedidas()";
$combo_um = '';
$resa = $mysqli->exeQuery($sqla) or die($mysqli->error.__LINE__);
$selum = 'UN';
$select = '';
if ($c_txt == ''){
	if ($resa){
		while ($rowa = $resa->fetch_assoc()){
			$select='';
			if ($rowa['UnMedID']==$selum){
			$select = 'selected';
			}
			
			$combo_um = $combo_um ."<option ctd='".$rowa['UnMedQty']."' value='".$rowa['UnMedID']."' ".$select.">".$rowa['UnMedID']."</option>";
		}
		$resa->close();	
		$mysqli->check_result();	
	}
}
else {
	if ($resa){
		
		
		while ($rowa = $resa->fetch_assoc()){
		$select='';
			if ($rowa['UnMedID']==$selum){
			$select = 'selected';
			}
			$combo_um = $combo_um ."<option ctd='".$rowa['UnMedQty']."' value='".$rowa['UnMedID']."' ".$select.">".$rowa['UnMedTxt']."</option>";
		}
		$resa->close();	
		$mysqli->check_result();	
	}
}
?>

